﻿using ckj.model;
using ckj.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace ckj.Controllers
{
    public class LoginController : Controller
    {
        private static readonly NLog.Logger Logger = NLog.LogManager.GetCurrentClassLogger();
        // GET: Login
        public ActionResult Index()
        {
            return View();
        }

        //登录控制器
        public ActionResult Login(string 工号)
        {
            Logger.Info(工号);
            HttpData<object> httpdata = new Models.HttpData<object>();
            V_USR usr = SqlSugarHelp.scope.Queryable<V_USR>().Where(it => it.USERNO == 工号).First();
            if (usr != null)
            {
                httpdata.code = 200;
            }
            else
            {
                httpdata.code = 1;
                httpdata.msg = "未查询到账号";
            }
            return Json(httpdata);
        }
    }
}